
import java.util.Scanner;
class QUERM {
    public static void main(String[] args) {
        Scanner entrada = new Scanner(System.in);
        int N;
        int V = 0, n = 1;
        while ((N = entrada.nextInt()) != 0) {
            int[] P = new int[N];
            for (int i = 0; i < N; i++) {
                P[i] = entrada.nextInt();
                if (P[i] == i+1) {
                    V = P[i];
                }
            }
            System.out.println("Teste " + n++);
            System.out.println(V);
            System.out.println();
        }
    }
}
